home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / bbintro.lha / BootIntro2.s / intro_muzak.S < prev    next >
Encoding:
Text File  |  1980-01-01  |  16.8 KB  |  1,054 lines

  1. org    $40000
  2. load    $40000
  3. *****************************
  4. ***   BTC of SARGON !!!   ***
  5. ***      Call Germany     ***
  6. ***      02202/36903      ***
  7. *****************************
  8. ***     GFX to $76000     ***
  9. ***    Module to $42000   ***
  10. *****************************
  11. *** This Intro is useful  ***
  12. *** for the Bootintro !!! ***
  13. *****************************
  14. ***  Sound shouldn`t be   ***
  15. ***  longer than $52000   ***
  16. *****************************
  17. s:
  18. bset    #1,$bfe001
  19. bsr    mt_init
  20. lea    $52000,a0
  21. lea    $61000,a1
  22. l1:
  23. clr.l    (a0)+
  24. cmp.l    a0,a1
  25. bne    l1
  26. lea    $70000,a0
  27. lea    $71000,a1
  28. l2:
  29. clr.l    (a0)+
  30. cmp.l    a0,a1
  31. bne    l2
  32.  
  33. lea    coppar,a0
  34. move.l    #$7811fffe,d0
  35. move.w    #$0182,d1
  36. lea    color,a1
  37. move.w    #6,d3
  38. nt:
  39. move.w    #16,d2
  40. makec1:
  41. move.l    d0,(a0)+
  42. move.w    d1,(a0)+
  43. move.w    (a1)+,(a0)+
  44. add.l    #$01000000,d0
  45. sub.w    #1,d2
  46. bne    makec1
  47. add.l    #$02000000,d0
  48. sub.w    #1,d3
  49. bne    nt
  50.  
  51. lea    $76000,a0
  52. lea    $50000,a1
  53. bsr    unpack
  54. bsr    setupcol
  55. bsr    mb
  56.  
  57. move.l    $04,a6
  58. jsr    -132(a6)
  59. lea    gfxname,a1
  60. jsr    -408(a6)
  61. move.l    d0,gfxbase
  62. move.l    d0,a0
  63. move.l    50(a0),oldclist
  64. move.l    #newclist,50(a0)
  65. move.l    $6c,oldirq+2
  66. move.l    #newirq,$6c
  67. wait:
  68. btst    #6,$bfe001
  69. bne.s    wait
  70. move.l    oldirq+2,$6c
  71. move.l    gfxbase,a0
  72. move.l    oldclist,50(a0)
  73. move.l    $04,a6
  74. move.l    gfxbase,a1
  75. jsr    -414(a6)
  76. jsr    -138(a6)
  77. bsr    mt_end
  78. rts
  79.  
  80. newirq:
  81. movem.l    d0-d7/a0-a6,-(sp)
  82.  
  83. bsr    makeall
  84. bsr    blittall
  85. bsr    makescrolly
  86. bsr    stars
  87. bsr    scroll
  88. bsr    blittotti
  89. sub.w    #1,w2
  90. bne    exit
  91. move.w    #4,w2
  92. sub.l    #8,wert
  93. cmp.l    #$51ef0,wert
  94. bpl    exit
  95. move.l    #$51f10,wert
  96. exit:
  97. movem.l    (sp)+,d0-d7/a0-a6
  98. oldirq:
  99. jmp    $00000000
  100.  
  101. newclist:
  102. dc.w    $008e,$2c81,$0090,$30c1,$0092,$0038,$0094,$00d0
  103. dc.w    $0102,$0000,$0104,$0000,$0108,40,$010a,0
  104. dc.w    $0100,$3400
  105. dc.w    $00e0,$0005,$00e2,$3000,$00e4,$0006,$00e6,$0000
  106. dc.w    $00e8,$0005,$00ea,$3028
  107. copcol:
  108. blk.l    4,0
  109. dc.w    $120,0,$122,0,$124,0,$126,0,$128,0,$12a,0,$12c,0,$12e,0
  110. dc.w    $130,0,$132,0,$134,0,$136,0,$138,0,$13a,0,$13c,0,$13e,0
  111. dc.w    $1011,$fffe,$180,1
  112. dc.w    $7611,$fffe,$0100,$2200
  113. dc.w    $e0,$5,$e2,$3000+[74*80],$e4,$5,$e6,$3028+[74*80],$10a,40
  114. dc.w    $192,$fff
  115. coppar:
  116. blk.w    6*16*4,0
  117. dc.w    $e511,$fffe,$180,1
  118. dc.w    $e611,$fffe,$180,2
  119. dc.w    $e711,$fffe,$180,3
  120. dc.w    $e811,$fffe,$180,4
  121. dc.w    $e911,$fffe,$e2,$8000,$e6,$8028,$180,5,$182,$fff,$184,$0
  122. dc.w    $186,$e4e
  123. dc.w    $ffe1,$fffe,$190,0
  124. dc.w    $1a11,$fffe,$00e0,$0007,$00e4,$0007,$00e2,$0002
  125. dc.w    $00e6,$002e,$182,$999,$108,48,$010a,48
  126.  
  127. dc.w    $1c11,$fffe,$180,$400
  128. dc.w    $1d11,$fffe,$180,$600
  129. dc.w    $1e11,$fffe,$180,$800
  130. dc.w    $1f11,$fffe,$180,$600
  131. dc.w    $2011,$fffe,$180,$400
  132. dc.w    $2111,$fffe,$180,$4
  133.  
  134. dc.w    $2411,$fffe,$180,$400
  135. dc.w    $2511,$fffe,$180,$600
  136. dc.w    $2611,$fffe,$180,$800
  137. dc.w    $2711,$fffe,$180,$600
  138. dc.w    $2811,$fffe,$180,$400
  139. dc.w    $2911,$fffe,$180,$4
  140.  
  141. dc.w    $2c11,$fffe,$180,4
  142. dc.w    $2d11,$fffe,$180,3
  143. dc.w    $2e11,$fffe,$180,2
  144. dc.w    $2f11,$fffe,$180,1
  145. dc.w    $3011,$fffe,$180,0
  146. dc.w    $ffff,$fffe
  147.  
  148. oldclist:
  149. dc.l    0
  150. gfxbase:
  151. dc.l    0
  152. gfxname:
  153. dc.b    "graphics.library",0
  154. even
  155. unpack:
  156.     add.l    #12,a0
  157.     move.l    4(a0),d0
  158.     add.l    d0,a0
  159.     add.l    #8,a0
  160.     move.l    a0,cmapchunk
  161.  
  162. iff1:    cmp.l    #$424f4459,(a0)
  163.     beq    iff0
  164.     add.l    #2,a0
  165.     bra    iff1
  166.  
  167. iff0:    move.l    4(a0),d0    ; Anzahl Bytes
  168.     add.l    #1,d0
  169.     and.l    #$fffffffe,d0
  170.  
  171.     add.l    #8,a0        ; Pointer to first Byte
  172.  
  173. iff4:    clr.l    d2
  174.     move.b    (a0)+,d2
  175.     bmi    iff6
  176.  
  177. iff5:    move.b    (a0)+,(a1)+
  178.     subi.l    #1,d0
  179.     subi.b    #1,d2
  180.     bpl    iff5
  181.     bra    iff7
  182.     
  183. iff6:    neg.b    d2
  184.     beq    iff7
  185.  
  186. iff61:    move.b    (a0),(a1)+
  187.     subi.b    #1,d2
  188.     bpl    iff61
  189.     subi.l    #1,d0
  190.     add.l    #1,a0
  191.  
  192. iff7:    subi.l    #1,d0
  193.     bmi    iff8
  194.     beq    iff8
  195.     bra    iff4
  196.  
  197. iff8:    move.l    cmapchunk,a0
  198.     move.l    cmap,a1
  199.     add.l    #8,a0
  200.     move.l    #8,d0
  201.  
  202. cmaploop:
  203.     clr.l    d1
  204.     move.b    (a0),d1
  205.     lsl.w    #4,d1
  206.     move.b    2(a0),d1
  207.     lsr.b    #4,d1
  208.     or.b    1(a0),d1
  209.     move.w    d1,(a1)+
  210.     add.l    #3,a0
  211.     sub.w    #1,d0
  212.     bne    cmaploop
  213.     rts
  214.  
  215. cmapchunk:
  216.     dc.l    0
  217.  
  218. cmap:    dc.l    color1
  219.  
  220. color1:    blk.w    8,0
  221.  
  222. setupcol:        ; Set Colors
  223. lea    color1,a0
  224. lea    copcol,a1
  225. move.l    #$01800000,d0
  226. move.l    #4,d1
  227.  
  228. suc1:
  229. move.w    (a0)+,d0
  230. move.l    d0,(a1)+
  231. add.l    #$00020000,d0
  232. sub.w    #1,d1
  233. bne    suc1
  234. rts
  235. adr:
  236. dc.l    $500f8,$500fc,$50100,$50104,$50108,$5010c
  237. badr:
  238. dc.l    $53008,$5300c,$53010+160,$53014+320,$53018+480
  239. dc.l    $5301c+640
  240. blittall:
  241. move.w    #6,d2
  242. lea    adr,a0
  243. lea    badr,a1
  244. notblittet:
  245. move.l    (a0)+,d0
  246. move.l    (a1)+,d1
  247. bsr    blittp
  248. sub.w    #1,d2
  249. bne    notblittet
  250. rts
  251.  
  252. blittp:
  253. move.l    d0,$dff050
  254. move.l    d1,$dff054
  255. move.w    #36,$dff064
  256. move.w    #36,$dff066
  257. move.w    #$ffff,$dff044
  258. move.w    #$ffff,$dff046
  259. move.l    #$09f00000,$dff040
  260. move.w    #$1702,$dff058
  261. waitp:
  262. btst    #6,$dff002
  263. bne    waitp
  264. rts
  265.  
  266. makeall:
  267. lea    badr,a1
  268. move.l    sz1,a0
  269. bsr    getsinus
  270. move.l    a0,sz1
  271.  
  272. move.l    sz2,a0
  273. bsr    getsinus
  274. move.l    a0,sz2
  275.  
  276. move.l    sz3,a0
  277. bsr    getsinus
  278. move.l    a0,sz3
  279.  
  280. move.l    sz4,a0
  281. bsr    getsinus
  282. move.l    a0,sz4
  283.  
  284. move.l    sz5,a0
  285. bsr    getsinus
  286. move.l    a0,sz5
  287.  
  288. move.l    sz6,a0
  289. bsr    getsinus
  290. move.l    a0,sz6
  291. rts
  292.  
  293. getsinus:
  294. move.l    (a0)+,d0
  295. cmp.l    #$ffff,d0
  296. bne    notf
  297. lea    sd,a0
  298. move.l    (a0)+,d0
  299. notf:
  300. add.l    d0,(a1)+
  301. rts
  302. sd:
  303. dc.l    0,0,0,80,80,80,80,80,80,160,160,160,160,240,240,320,320
  304. dc.l    -320,-320,-240,-240,-160,-160,-160,-160,-80,-80,-80,-80
  305. dc.l    -80,-80
  306. dc.l    $ffff
  307. sz1:    dc.l    sd
  308. sz2:    dc.l    sd+[2*4]
  309. sz3:    dc.l    sd+[4*4]
  310. sz4:    dc.l    sd+[6*4]
  311. sz5:    dc.l    sd+[8*4]
  312. sz6:    dc.l    sd+[10*4]
  313.  
  314. mb:
  315. lea    board,a3
  316. move.l    #$546d0+[3*80],d3
  317. move.w    #6,d5
  318. nnar:
  319. move.w    #20,d4
  320. notall:
  321. move.b    (a3)+,d0
  322. bsr    makesen
  323. add.l    #2,d3
  324. sub.w    #1,d4
  325. bne    notall
  326. add.l    #[35*40],d3
  327. sub.w    #1,d5
  328. bne    nnar
  329. rts
  330.  
  331. makesen:
  332. move.l    #45,d1
  333. lea    ascii,a0
  334. nrc:
  335. cmp.b    (a0,d1.l),d0
  336. beq    printit
  337. sub.l    #1,d1
  338. bpl    nrc
  339. printit:
  340. lsl.l    #2,d1
  341. add.l    #atab,d1
  342. move.l    d1,a2
  343. move.l    (a2),d0
  344. move.l    d3,d1
  345. bsr    getchar
  346. rts
  347.  
  348. getchar:
  349. move.l    d0,$dff050
  350. move.l    d1,$dff054
  351. move.w    #38,$dff064
  352. move.w    #38,$dff066
  353. move.w    #$ffff,$dff044
  354. move.w    #$ffff,$dff046
  355. move.l    #$09f00000,$dff040
  356. move.w    #$0801,$dff058
  357. waitforchar:
  358. btst    #6,$dff002
  359. bne    waitforchar
  360. rts
  361. b = $50ff0
  362. c = $514f0
  363. d = $519f0
  364. atab:
  365. dc.l    b,b+2,b+4,b+6,b+8,b+10,b+12,b+14,b+16,b+18,b+20,b+22
  366. dc.l    b+24,b+26,b+28,b+30,b+32,b+34,b+36,b+38
  367. dc.l    c,c+2,c+4,c+6,c+8,c+10,c+12,c+14,c+16,c+18,c+20,c+22
  368. dc.l    c+24,c+26,c+28,c+30,c+32,c+34,c+36,c+38
  369. dc.l    d,d+2,d+4,d+6,d+8,d+10,d+12,d+14,d+16,d+18,d+20,d+22
  370. dc.l    d+24,d+26,d+28,d+30,d+32
  371. ascii:
  372. dc.b    "abcdefghijklmnopqrst"
  373. dc.b    "uvwxyz0123456789,-./"
  374. dc.b    ":! (*)"
  375. board:
  376. dc.b    "      presents:     "
  377. dc.b    "utealeeteas disk 001"
  378. dc.b    " intro,muzak by btc "
  379. dc.b    " contact us under : "
  380. dc.b    "    plk 073908 c    "
  381. dc.b    "5060 berg.gladbach 2"
  382. text:
  383. dc.b    "sargon ...  there*s a new mighty place on earth ... "
  384. dc.b    "hey there ... what a lousy intro , but i planed to put "
  385. dc.b    "it into the bootblock (as you can see (i hope so !!!)"
  386. dc.b    "...    credits for this intro : coding ... btc        "
  387. dc.b    "chars and gfx ... wow-phalanx-thrust    muzak ... "
  388. dc.b    "btc and danny (both sargon and not alpha flight)    "
  389. dc.b    "we send our handshakes to mighty guys like       "
  390. dc.b    "red sector (thanks for sending),phalanx (great work cable)"
  391. dc.b    ",vortex 42 (hi bonfire !!!),nemesis (only one disk ...)"
  392. dc.b    ",deathstar,thrust,alpha flight (mighty ...(only megatron))"
  393. dc.b    ",tjc,vision factory and beyonders (what about cracking for"
  394. dc.b    " you ...),wow,acid and to all our contacs around this "
  395. dc.b    "little world !!!   thanks must go to some italian and "
  396. dc.b    "australian software houses for some originals     "
  397. dc.b    "we are looking for new members ... contact us under :"
  398. dc.b    "plk 073908 c    5060 berg.gladbach 2       we were the "
  399. dc.b    "best alpha flighters ....    watch out for our demos and "
  400. dc.b    "cracks ...   "
  401. dc.b    "a message to all you there !!! don*t greet us under "
  402. dc.b    "alpha flight      it*s sargon time !!!      "
  403. dc.b    "there*s a good chance to get famous .... it*s called sargon"
  404. dc.b    " ....          "
  405. dc.b    0
  406. even
  407. textzeiger:    dc.l    text
  408.  
  409. makescrolly:
  410. sub.w    #1,shift
  411. bne    return
  412. move.w    #4,shift
  413. move.l    textzeiger,a0
  414. move.b    (a0)+,d0
  415. bne    notff
  416. lea    text,a0
  417. move.b    (a0)+,d0
  418. notff:
  419. move.l    #$7002a,d3
  420. move.l    a0,textzeiger
  421. bsr    searchchar
  422. return:
  423. rts
  424.  
  425. searchchar:
  426. move.l    #45,d1
  427. lea    ascii,a0
  428. nrc2:
  429. cmp.b    (a0,d1.l),d0
  430. beq    printit2
  431. sub.l    #1,d1
  432. bpl    nrc2
  433. printit2:
  434. lsl.l    #2,d1
  435. add.l    #atab,d1
  436. move.l    d1,a2
  437. move.l    (a2),d0
  438. move.l    d3,d1
  439. bsr    getchar2
  440. rts
  441.  
  442. getchar2:
  443. move.l    d0,$dff050
  444. move.l    d1,$dff054
  445. move.w    #38,$dff064
  446. move.w    #42,$dff066
  447. move.w    #$ffff,$dff044
  448. move.w    #$ffff,$dff046
  449. move.l    #$09f00000,$dff040
  450. move.w    #$0801,$dff058
  451. waitforchar2:
  452. btst    #6,$dff002
  453. bne    waitforchar2
  454. rts
  455. scroll:
  456. move.l    #$70002,$dff050
  457. move.l    #$70000,$dff054
  458. move.w    #40,$dff064
  459. move.w    #40,$dff066
  460. move.w    #$ffff,$dff044
  461. move.w    #$0,$dff046
  462. move.l    #$c9f00000,$dff040
  463. move.w    #$0818,$dff058
  464. wait2getchar:
  465. btst    #6,$dff002
  466. bne    wait2getchar
  467. rts
  468. shift:    dc.w    8
  469. color:
  470. dc.w    $404,$505,$606,$707,$808,$909,$a0a,$b0b,$b0b,$a0a,$909,$808
  471. dc.w    $707,$606,$505,$404
  472. dc.w    4,5,6,7,8,9,10,11,11,10,9,8,7,6,5,4
  473. dc.w    $440,$550,$660,$770,$880,$990,$aa0,$bb0,$bb0,$aa0,$990,$880
  474. dc.w    $770,$660,$550,$440
  475. dc.w    $444,$555,$666,$777,$888,$999,$aaa,$bbb,$bbb,$aaa,$999,$888
  476. dc.w    $777,$666,$555,$444
  477. dc.w    $400,$500,$600,$700,$800,$900,$a00,$b00,$b00,$a00,$900,$800
  478. dc.w    $700,$600,$500,$400
  479. dc.w    $40,$50,$60,$70,$80,$90,$a0,$b0,$b0,$a0,$90,$80,$70,$60,$50
  480. dc.w    $40
  481. blittotti:
  482. move.l    wert,$dff050
  483. move.l    #$58010,$dff054
  484. move.w    #32,$dff064
  485. move.w    #32,$dff066
  486. move.w    #$ffff,$dff044
  487. move.w    #$ffff,$dff046
  488. move.l    #$09f00000,$dff040
  489. move.w    #$1804,$dff058
  490. bsr    mt_music
  491. waitforotti:
  492. btst    #6,$dff002
  493. bne    waitforotti
  494. rts
  495. wert:    dc.l    $51f10
  496. w2:    dc.w    3
  497. stars:
  498. lea    startab,a5
  499. move.w    #138,d5
  500.  
  501. lea    $60000,a0
  502. clr.l    d7
  503. clr.l    d0
  504. sub.w    #1,d5
  505.  
  506. nextstar:
  507. move.w    (a5),d0
  508. move.w    2(a5),d1
  509. move.w    4(a5),d3
  510. add.w    d3,(a5)
  511.  
  512. mulu    #40,d1
  513. move.w    d1,d7
  514. move.w    d0,d2
  515. lsr    #3,d0
  516. add.w    d0,d7
  517. and.w    #7,d2
  518. moveq    #7,d0
  519. sub.w    d2,d0
  520. bclr    d0,(a0,d7.w)
  521. cmp.w    #320,(a5)
  522. bcs    contsp
  523. sub.w    #320,(a5)
  524.  
  525. contsp:
  526. move.w    (a5),d0
  527. move.w    d0,d2
  528. lsr.w    #3,d0
  529. add.w    d0,d1
  530. and.w    #7,d0
  531. moveq    #7,d0
  532. sub.w    d2,d0
  533. bset    d0,(a0,d1.w)
  534. add.w    #6,a5
  535. dbf    d5,nextstar
  536. rts
  537.  
  538. startab:
  539. dc.w    182,0,10
  540. dc.w    89,0,8
  541. dc.w    120,1,7
  542. dc.w    262,1,1
  543. dc.w    165,2,7
  544. dc.w    171,2,9
  545. dc.w    251,3,6
  546. dc.w    54,3,10
  547. dc.w    143,4,9
  548. dc.w    103,4,6
  549. dc.w    85,5,8
  550. dc.w    240,5,7
  551. dc.w    2,6,9
  552. dc.w    46,6,1
  553. dc.w    119,7,10
  554. dc.w    9,7,4
  555. dc.w    177,8,9
  556. dc.w    191,8,8
  557. dc.w    121,9,6
  558. dc.w    33,9,10
  559. dc.w    94,10,2
  560. dc.w    287,10,1
  561. dc.w    247,11,8
  562. dc.w    124,11,10
  563. dc.w    204,12,3
  564. dc.w    279,12,8
  565. dc.w    180,13,8
  566. dc.w    237,13,7
  567. dc.w    221,14,7
  568. dc.w    163,14,6
  569. dc.w    44,15,4
  570. dc.w    238,15,9
  571. dc.w    273,16,4
  572. dc.w    226,16,1
  573. dc.w    20,17,5
  574. dc.w    135,17,5
  575. dc.w    101,18,3
  576. dc.w    139,18,10
  577. dc.w    258,19,1
  578. dc.w    127,19,3
  579. dc.w    167,20,10
  580. dc.w    135,20,4
  581. dc.w    101,21,8
  582. dc.w    123,21,4
  583. dc.w    131,22,9
  584. dc.w    153,22,4
  585. dc.w    177,23,1
  586. dc.w    8,23,5
  587. dc.w    34,24,8
  588. dc.w    219,24,4
  589. dc.w    146,25,4
  590. dc.w    26,25,3
  591. dc.w    273,26,4
  592. dc.w    232,26,7
  593. dc.w    159,27,8
  594. dc.w    260,27,4
  595. dc.w    286,28,2
  596. dc.w    122,28,9
  597. dc.w    251,29,5
  598. dc.w    252,29,7
  599. dc.w    130,30,9
  600. dc.w    118,30,9
  601. dc.w    272,31,8
  602. dc.w    181,31,2
  603. dc.w    64,32,2
  604. dc.w    122,32,8
  605. dc.w    74,33,2
  606. dc.w    68,33,7
  607. dc.w    43,34,9
  608. dc.w    314,34,6
  609. dc.w    256,35,3
  610. dc.w    102,35,2
  611. dc.w    205,36,3
  612. dc.w    109,36,4
  613. dc.w    277,37,9
  614. dc.w    48,37,8
  615. dc.w    264,38,5
  616. dc.w    45,38,9
  617. dc.w    238,39,6
  618. dc.w    249,39,1
  619. dc.w    182,40,1
  620. dc.w    89,40,3
  621. dc.w    120,41,5
  622. dc.w    262,41,1
  623. dc.w    165,42,7
  624. dc.w    171,42,3
  625. dc.w    251,43,6
  626. dc.w    54,43,2
  627. dc.w    143,44,5
  628. dc.w    103,44,6
  629. dc.w    85,45,3
  630. dc.w    240,45,7
  631. dc.w    2,46,4
  632. dc.w    46,46,1
  633. dc.w    119,47,4
  634. dc.w    9,47,5
  635. dc.w    177,48,8
  636. dc.w    191,48,2
  637. dc.w    121,49,6
  638. dc.w    33,49,1
  639. dc.w    68,50,5
  640. dc.w    43,50,1
  641. dc.w    314,51,3
  642. dc.w    256,51,5
  643. dc.w    102,52,6
  644. dc.w    205,52,3
  645. dc.w    109,53,3
  646. dc.w    277,53,2
  647. dc.w    48,54,6
  648. dc.w    264,54,1
  649. dc.w    45,55,5
  650. dc.w    238,55,2
  651. dc.w    249,56,6
  652. dc.w    182,56,8
  653. dc.w    89,57,1
  654. dc.w    120,57,5
  655. dc.w    262,58,2
  656. dc.w    165,58,6
  657. dc.w    171,59,4
  658. dc.w    251,59,3
  659. dc.w    130,60,1
  660. dc.w    118,60,7
  661. dc.w    272,61,8
  662. dc.w    181,61,2
  663. dc.w    64,62,1
  664. dc.w    122,62,8
  665. dc.w    74,63,2
  666. dc.w    68,63,7
  667. dc.w    43,64,3
  668. dc.w    314,64,6
  669. dc.w    256,65,5
  670. dc.w    102,65,2
  671. dc.w    205,66,3
  672. dc.w    109,66,4
  673. dc.w    277,67,7
  674. dc.w    48,67,8
  675. dc.w    264,68,5
  676. dc.w    45,68,3
  677. dc.w    238,69,2
  678. dc.w    249,69,1
  679.  
  680. mt_init:lea    mt_data,a0
  681.     add.l    #$01d8,a0
  682.     move.l    #$0080,d0
  683.     moveq    #$00,d1
  684. mt_init1:
  685.     move.l    d1,d2
  686.     subq.w    #1,d0
  687. mt_init2:
  688.     move.b    (a0)+,d1
  689.     cmp.b    d2,d1
  690.     bgt.s    mt_init1
  691.     dbf    d0,mt_init2
  692.     addq.b    #1,d2
  693.  
  694. mt_init3:
  695.     lea    mt_data,a0
  696.     lea    mt_sample1,a1
  697.     asl.l    #$08,d2
  698.     asl.l    #$02,d2
  699.     add.l    #$0258,d2
  700.     add.l    a0,d2
  701.     moveq    #$0e,d0
  702. mt_init4:
  703.     move.l    d2,(a1)+
  704.     moveq    #$00,d1
  705.     move.w    42(a0),d1
  706.     asl.l    #1,d1
  707.     add.l    d1,d2
  708.     add.l    #$1e,a0
  709.     dbf    d0,mt_init4
  710.  
  711.     lea    mt_sample1,a0
  712.     moveq    #$00,d0
  713. mt_clear:
  714.     move.l    (a0,d0),a1
  715.     clr.l    (a1)
  716.     addq.l    #4,d0
  717.     cmp.l    #$3c,d0
  718.     bne.s    mt_clear
  719.  
  720.     clr.w    $dff0a8
  721.     clr.w    $dff0b8
  722.     clr.w    $dff0c8
  723.     clr.w    $dff0d8
  724.     clr.l    mt_partnrplay
  725.     clr.l    mt_partnote
  726.     clr.l    mt_partpoint
  727.  
  728.     move.b    mt_data+$1d6,mt_maxpart+1
  729.     rts
  730.  
  731. mt_end:    clr.w    $dff0a8
  732.     clr.w    $dff0b8
  733.     clr.w    $dff0c8
  734.     clr.w    $dff0d8
  735.     move.w    #$000f,$dff096
  736.     rts
  737.  
  738. mt_music:
  739.     addq.l    #1,mt_counter
  740. mt_cool:cmp.l    #6,mt_counter
  741.     bne.s    mt_notsix
  742.     clr.l    mt_counter
  743.     bra    mt_rout2
  744.  
  745. mt_notsix:
  746.     lea    mt_aud1temp,a6
  747.     tst.b    3(a6)
  748.     beq.s    mt_arp1
  749.     lea    $dff0a0,a5        
  750.     bsr.s    mt_arprout
  751. mt_arp1:lea    mt_aud2temp,a6
  752.     tst.b    3(a6)
  753.     beq.s    mt_arp2
  754.     lea    $dff0b0,a5
  755.     bsr.s    mt_arprout
  756. mt_arp2:lea    mt_aud3temp,a6
  757.     tst.b    3(a6)
  758.     beq.s    mt_arp3
  759.     lea    $dff0c0,a5
  760.     bsr.s    mt_arprout
  761. mt_arp3:lea    mt_aud4temp,a6
  762.     tst.b    3(a6)
  763.     beq.s    mt_arp4
  764.     lea    $dff0d0,a5
  765.     bra.s    mt_arprout
  766. mt_arp4:rts
  767.  
  768. mt_arprout:
  769.     move.b    2(a6),d0
  770.     and.b    #$0f,d0
  771.     tst.b    d0
  772.     beq.s    mt_arpegrt
  773.     cmp.b    #1,d0
  774.     beq.s    mt_portup
  775.     cmp.b    #2,d0
  776.     beq.s    mt_portdwn
  777.     rts
  778.  
  779. mt_portup:
  780.     moveq    #$00,d0
  781.     move.b    3(a6),d0
  782.     sub.w    d0,22(a6)
  783.     cmp.w    #$71,22(a6)
  784.     bpl.s    mt_ok1
  785.     move.w    #$71,22(a6)
  786. mt_ok1:    move.w    22(a6),6(a5)
  787.     rts
  788.  
  789. mt_portdwn:
  790.     moveq    #$00,d0
  791.     move.b    3(a6),d0
  792.     add.w    d0,22(a6)
  793.     cmp.w    #$358,22(a6)
  794.     bmi.s    mt_ok2
  795.     move.w    #$358,22(a6)
  796. mt_ok2:    move.w    22(a6),6(a5)
  797.     rts
  798.  
  799. mt_arpegrt:
  800.     cmp.l    #1,mt_counter
  801.     beq.s    mt_loop2
  802.     cmp.l    #2,mt_counter
  803.     beq.s    mt_loop3
  804.     cmp.l    #3,mt_counter
  805.     beq.s    mt_loop4
  806.     cmp.l    #4,mt_counter
  807.     beq.s    mt_loop2
  808.     cmp.l    #5,mt_counter
  809.     beq.s    mt_loop3
  810.     rts
  811.  
  812. mt_loop2:
  813.     moveq    #$00,d0
  814.     move.b    3(a6),d0
  815.     lsr.b    #4,d0
  816.     bra.s    mt_cont
  817. mt_loop3:
  818.     moveq    #$00,d0
  819.     move.b    3(a6),d0
  820.     and.b    #$0f,d0
  821.     bra.s    mt_cont
  822. mt_loop4:
  823.     move.w    16(a6),d2
  824.     bra.s    mt_endpart
  825. mt_cont:
  826.     asl.w    #1,d0
  827.     moveq    #$00,d1
  828.     move.w    16(a6),d1
  829.     lea    mt_arpeggio,a0
  830. mt_loop5:
  831.     move.w    (a0,d0),d2
  832.     cmp.w    (a0),d1
  833.     beq.s    mt_endpart
  834.     addq.l    #2,a0
  835.     bra.s    mt_loop5
  836. mt_endpart:
  837.     move.w    d2,6(a5)
  838.     rts
  839.  
  840. mt_rout2:
  841.     lea    mt_data,a0
  842.     move.l    a0,a3
  843.     add.l    #$0c,a3
  844.     move.l    a0,a2
  845.     add.l    #$1d8,a2
  846.     add.l    #$258,a0
  847.     move.l    mt_partnrplay,d0
  848.     moveq    #$00,d1
  849.     move.b    (a2,d0),d1
  850.     asl.l    #$08,d1
  851.     asl.l    #$02,d1
  852.     add.l    mt_partnote,d1
  853.     move.l    d1,mt_partpoint
  854.     clr.w    mt_dmacon
  855.  
  856.     lea    $dff0a0,a5
  857.     lea    mt_aud1temp,a6
  858.     bsr    mt_playit
  859.     lea    $dff0b0,a5
  860.     lea    mt_aud2temp,a6
  861.     bsr    mt_playit
  862.     lea    $dff0c0,a5
  863.     lea    mt_aud3temp,a6
  864.     bsr    mt_playit
  865.     lea    $dff0d0,a5
  866.     lea    mt_aud4temp,a6
  867.     bsr    mt_playit
  868.     move.w    #$01f4,d0
  869. mt_rls:    dbf    d0,mt_rls
  870.  
  871.     move.w    #$8000,d0
  872.     or.w    mt_dmacon,d0
  873.     move.w    d0,$dff096
  874.  
  875.     lea    mt_aud4temp,a6
  876.     cmp.w    #1,14(a6)
  877.     bne.s    mt_voice3
  878.     move.l    10(a6),$dff0d0
  879.     move.w    #1,$dff0d4
  880. mt_voice3:
  881.     lea    mt_aud3temp,a6
  882.     cmp.w    #1,14(a6)
  883.     bne.s    mt_voice2
  884.     move.l    10(a6),$dff0c0
  885.     move.w    #1,$dff0c4
  886. mt_voice2:
  887.     lea    mt_aud2temp,a6
  888.     cmp.w    #1,14(a6)
  889.     bne.s    mt_voice1
  890.     move.l    10(a6),$dff0b0
  891.     move.w    #1,$dff0b4
  892. mt_voice1:
  893.     lea    mt_aud1temp(pc),a6
  894.     cmp.w    #1,14(a6)
  895.     bne.s    mt_voice0
  896.     move.l    10(a6),$dff0a0
  897.     move.w    #1,$dff0a4
  898. mt_voice0:
  899.     move.l    mt_partnote,d0
  900.     add.l    #$10,d0
  901.     move.l    d0,mt_partnote
  902.     cmp.l    #$400,d0
  903.     bne.s    mt_stop
  904. mt_higher:
  905.     clr.l    mt_partnote
  906.     addq.l    #1,mt_partnrplay
  907.     moveq    #$00,d0
  908.     move.w    mt_maxpart,d0
  909.     move.l    mt_partnrplay,d1
  910.     cmp.l    d0,d1
  911.     bne.s    mt_stop
  912.     clr.l    mt_partnrplay
  913.  
  914. mt_stop:tst.w    mt_status
  915.     beq.s    mt_stop2
  916.     clr.w    mt_status
  917.     bra.s    mt_higher
  918. mt_stop2:
  919.     rts
  920.  
  921. mt_playit:
  922.     move.l    (a0,d1),(a6)
  923.     addq.l    #4,d1
  924.     moveq    #$00,d2
  925.     move.b    2(a6),d2
  926.     and.b    #$f0,d2
  927.     lsr.b    #4,d2
  928.     tst.b    d2
  929.     beq.s    mt_nosamplechange
  930.  
  931.     moveq    #$00,d3
  932.     lea    mt_samples(pc),a1
  933.     move.l    d2,d4
  934.     asl.l    #2,d2
  935.     mulu    #$1e,d4
  936.     move.l    (a1,d2),4(a6)
  937.     move.w    (a3,d4),8(a6)
  938.     move.w    2(a3,d4),18(a6)
  939.     move.w    4(a3,d4),d3
  940.     tst.w    d3
  941.     beq.s    mt_displace
  942.     move.l    4(a6),d2
  943.     add.l    d3,d2
  944.     move.l    d2,4(a6)
  945.     move.l    d2,10(a6)
  946.     move.w    6(a3,d4),8(a6)
  947.     move.w    6(a3,d4),14(a6)
  948.     move.w    18(a6),8(a5)
  949.     bra.s    mt_nosamplechange
  950.  
  951. mt_displace:
  952.     move.l    4(a6),d2
  953.     add.l    d3,d2
  954.     move.l    d2,10(a6)
  955.     move.w    6(a3,d4),14(a6)
  956.     move.w    18(a6),8(a5)
  957. mt_nosamplechange:
  958.     tst.w    (a6)
  959.     beq.s    mt_retrout
  960.     move.w    (a6),16(a6)
  961.     move.w    20(a6),$dff096
  962.     move.l    4(a6),(a5)
  963.     move.w    8(a6),4(a5)
  964.     move.w    (a6),6(a5)
  965.     move.w    20(a6),d0
  966.     or.w    d0,mt_dmacon
  967.  
  968. mt_retrout:
  969.     tst.w    (a6)
  970.     beq.s    mt_nonewper
  971.     move.w    (a6),22(a6)
  972.  
  973. mt_nonewper:
  974.     move.b    2(a6),d0
  975.     and.b    #$0f,d0
  976.     cmp.b    #11,d0
  977.     beq.s    mt_posjmp
  978.     cmp.b    #12,d0
  979.     beq.s    mt_setvol
  980.     cmp.b    #13,d0
  981.     beq.s    mt_break
  982.     cmp.b    #14,d0
  983.     beq.s    mt_setfil
  984.     cmp.b    #15,d0
  985.     beq.s    mt_setspeed
  986.     rts
  987.  
  988. mt_posjmp:
  989.     not.w    mt_status
  990.     moveq    #$00,d0
  991.     move.b    3(a6),d0
  992.     subq.b    #$01,d0
  993.     move.l    d0,mt_partnrplay
  994.     rts
  995.  
  996. mt_setvol:
  997.     move.b    3(a6),8(a5)
  998.     rts
  999.  
  1000. mt_break:
  1001.     not.w    mt_status
  1002.     rts
  1003.  
  1004. mt_setfil:
  1005.     moveq    #$00,d0
  1006.     move.b    3(a6),d0
  1007.     and.b    #$01,d0
  1008.     rol.b    #$01,d0
  1009.     and.b    #$fd,$bfe001
  1010.     or.b    d0,$bfe001
  1011.     rts
  1012.  
  1013. mt_setspeed:
  1014.     move.b    3(a6),d0
  1015.     and.b    #$0f,d0
  1016.     beq.s    mt_back
  1017.     clr.l    mt_counter
  1018.     move.b    d0,mt_cool+5
  1019. mt_back:rts
  1020.  
  1021. mt_aud1temp:
  1022.     blk.w    10,0
  1023.     dc.w    $0001
  1024.     blk.w    2,0
  1025. mt_aud2temp:
  1026.     blk.w    10,0
  1027.     dc.w    $0002
  1028.     blk.w    2,0
  1029. mt_aud3temp:
  1030.     blk.w    10,0
  1031.     dc.w    $0004
  1032.     blk.w    2,0
  1033. mt_aud4temp:
  1034.     blk.w    10,0
  1035.     dc.w    $0008
  1036.     blk.w    2,0
  1037. mt_partnote:    dc.l    0
  1038. mt_partnrplay:    dc.l    0
  1039. mt_counter:    dc.l    0
  1040. mt_partpoint:    dc.l    0
  1041. mt_samples:dc.l    0
  1042. mt_sample1:blk.l 15,0
  1043. mt_maxpart:dc.w    $0000
  1044. mt_dmacon:dc.w    $0000
  1045. mt_status:dc.w    $0000
  1046.  
  1047. mt_arpeggio:
  1048. dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
  1049. dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
  1050. dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
  1051. dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
  1052. dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000
  1053. mt_Data = $42000
  1054.